

<CFQUERY NAME="GetSchedules" DATASOURCE="#client.company_dsn#">
	SELECT CMF.PERSONNELIDNO,CMF.LASTNAME,CMF.FIRSTNAME,CMF.MIDDLENAME,CIN.WORKSKEDCODE,CLK.DESCRIPTION
	FROM CMFPA CMF,CINWSMASTER CIN,CLKWORKSKED CLK
	WHERE (CMF.PERSONNELIDNO = CIN.PERSONNELIDNO)
	AND   (CMF.SUPERIORCODE = '#client.chapa#')
	AND   (CIN.ACTIVESKED = 'Y')
	AND   (CIN.WORKSKEDCODE = CLK.WORKSKEDCODE) 
	ORDER BY CMF.LASTNAME  
</CFQUERY>

<TABLE BORDER=0 CELLPADDING=0 CELLSPACING="2" WIDTH="100%">
  <CFIF GetSchedules.RecordCount>	
	<TR>
	    <TD CLASS="bold" NOWRAP>Personnel ID No.</TD>
		<TD CLASS="bold" NOWRAP>Employee Name</TD>
		<TD CLASS="bold" NOWRAP>WorkSked Code</TD>
		<TD CLASS="bold" NOWRAP>Sked Description</td>
	</TR>
	
	<CFOUTPUT QUERY="GetSchedules">
		<TR>
		    <TD CLASS="regualr11" NOWRAP>&nbsp;#GetSchedules.PERSONNELIDNO#&nbsp;</TD>
			<TD CLASS="regular11" NOWRAP>&nbsp;#GetSchedules.LASTNAME#,&nbsp;#GetSchedules.FIRSTNAME#&nbsp;#GetSchedules.MIDDLENAME#&nbsp;</TD>
			<TD CLASS="regular11" NOWRAP>&nbsp;#GetSchedules.WORKSKEDCODE#&nbsp;</TD>
			<TD CLASS="regular11" NOWRAP>&nbsp;#GetSchedules.DESCRIPTION#&nbsp;</TD>
			
		</TR>
	</CFOUTPUT>
  <CFELSE>
  		<TR><TD CLASS="bold11">No subordinates found in the master list</td></TR>
  </CFIF>
</TABLE>